﻿using SmartCity.Shared;

namespace CommonManagement
{
    /// <summary>
    /// 获取信息结果类
    /// </summary>
    public class UserGetInfoResponse: ActionResponse<UserGetInfoResponse>
    {
        /// <summary>用户信息</summary>
        public UserDto User { get; set; }

        /// <summary>
        /// 未找到
        /// </summary>
        /// <param name="userId"></param>
        public static UserGetInfoResponse NotFound(long userId)
        {
            return Failed(ResponseCode.未找到资源, $"用户 id = ${userId} 不存在！");
        }

        /// <summary>
        /// 成功
        /// </summary>
        /// <param name="user"></param>
        public static UserGetInfoResponse Successful(UserDto user)
        {
            var result = Successful();
            result.User = user;
            return result;
        }
    }
}